/*
 * AutoKey.h
 *
 *  Created on: 2021��5��7��
 *      Author: sunjipeng
 */

#ifndef AUTOKEY_H_
#define AUTOKEY_H_
//#include "Conf.h"
#include "Buzzer.h"
#include "UI.h"
#include "MorseUtils.h"
#include "Arduino.h"

enum KeyState {
	Up,
	Down
};
enum class CurrentKey {
	Idle,
	Left,
	Right
};
enum class State {
	LeftDown,
	RightDown,
	Idle
};
class AutoKey {
private:
	enum State state = State::Idle;
	unsigned long idleTm = 0; // ��������ʱ��
	
	unsigned int left_pin = 12;
	unsigned int right_pin = 13;
public:
	void init();
	void run();
};

extern class AutoKey autoKey;
extern Buzzer buzzer;
extern MorseUtils morse;
extern UI ui;
extern unsigned long dit_tm;
#endif /* AUTOKEY_H_ */
